#include "babelclient.h"
#include <iostream>
#include "BabelApi.h"
#include "ApiSound.h"
#include "ApiNetwork.h"
#include "ApiBabelGui.h"

BabelClient::BabelClient(int argc, char *argv[]) : _networkManager(_proc)
{
	BabelApi*	api = new BabelApi(new ApiSound(_soundManager),
									new ApiNetwork(_networkManager),
									new ApiBabelGui(_gui));
	_proc.setAPI(api);
	connect(&_gui, SIGNAL(_emitQuit()), this, SLOT(Quit()));
	_gui.show();
	if (argc >= 3)
		_networkManager.ConnectToServer(std::string(argv[1]), std::string(argv[2])); 
	else
		_networkManager.ConnectToServer("10.16.253.252", "4242"); 

}

BabelClient::~BabelClient()
{

}
#include <stdio.h>
void			BabelClient::Quit()
{
	//FINISH ALL PROJECT CLEAN
}
